<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
	session.setAttribute("path", request.getContextPath());
%>
<html>
<head>

    <title>后台用户管理</title>
    <script type="text/javascript" src="${path}/js/jQuery.js"></script>
    <script src="${path}/js/jquery-2.1.1.min.js" type="text/javascript"></script>
   <script type="text/javascript">
 
   $(function(){
       $("#U_add").click(function(){
           self.location.href='manager/useradd.jsp';
       })
   })
   </script>
</head>
<body>
<center>
    <s:action name="header" executeResult="true" namespace="/"/>
    <table width="900">
        <tr>
            <td height="30">当前位置>>后台用户管理</td>
        </tr>
    </table>
    <form action="<s:url value="/manager_userlist.action"/>" method="post">
        <table width="900">
            <tr>
                <td>帐号：<input type="text" name="userId" value="<s:property value="userId"/>">&nbsp;&nbsp;<input type="submit" value="查询"/>&nbsp;<input type="button" value="新增用户" id="U_add"/></td>
            <td><input type="button" style="display: none" id="adduser" name="adduser" value="确定新增" onclick="useradd"></td>
            <td><input type="button" style="display: none" id="cancel" name="cancel" value="取消新增" onclick="canceladd"></td>
            </tr>
        </table>
    </form>
    <table width="900" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="#FFFFFF"  bordercolorlight="#888888">
        <tr bgcolor="#DDDDEE">
            <td height="35" width="20%">帐号</td>
            <td width="20%">昵称</td>
            <td width="20%">性别</td>
            <td width="20%">角色</td>
            <td width="20%">创建时间</td>
        </tr>
        <s:iterator value="userlist" id="f">
          <tr>
            <td height="35"><s:property value="#f.userId"/></td>
            <td><s:property value="#f.userName"/></td>
            <td><s:property value="#f.sex"/></td>
            <td><s:if test='#f.role=="1"'><font color="red">管理员</font></s:if><s:else>用户</s:else> </td>
            <td><s:date name="#f.createTime" format="yyyy-MM-dd HH:mm:ss" /></td>
           </tr>
        </s:iterator>
    </table>
    <table id="newuser" name="newuser" width="900" style="display: none">
    <tr>
    <td height="35" width="20%"><input type="text" id="userid" name="userid" placeholder="必须输入帐号"></td>
            <td width="20%"><select id="role" name="role">
            <option value="-1">请选择角色</option>
            <option value="1">管理员</option>
            <option value="2">普通用户</option>
            </select></td>
      
    </tr>
    </table>
</center>
</body>
</html>
